package us.mooresr.webtroopmanager.client.events;

import java.util.Set;

import us.mooresr.webtroopmanager.shared.Privilege;

import com.google.gwt.event.shared.GwtEvent;

public class PermissionChangedEvent extends GwtEvent<PermissionChangedHandler> {
	public static final Type<PermissionChangedHandler> TYPE = new Type<PermissionChangedHandler>();
	private final Set<Privilege> privileges;
	
	public PermissionChangedEvent(Set<Privilege> privileges) {
		super();
		this.privileges = privileges;
	}

	@Override
	protected void dispatch(PermissionChangedHandler handler) {
		handler.onPermissionChanged(this);
		
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<PermissionChangedHandler> getAssociatedType() {
		return TYPE;
	}
	
	public Set<Privilege> getPrivileges() {
		return privileges;
	}

}
